package cn.cs.client;

import cn.cs.common.Page;
import cn.cs.config.CsConfiguration;
import cn.cs.fallback.AccountDetailFallBack;
import cn.cs.fallback.CsPersonFallBack;
import cn.cs.pojo.AccountDetail;
import cn.cs.pojo.CsPerson;
import cn.cs.pojo.CsRoleUser;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

@FeignClient(name = "cs-user-provider", configuration = CsConfiguration.class, fallback = CsPersonFallBack.class)
public interface CsPersonClient {


    @RequestMapping(value = "/findPersonByName", method = RequestMethod.POST)
    public CsPerson findPersonByName(@RequestParam(value = "username") String username);

    @RequestMapping(value = "/findPersonById", method = RequestMethod.POST)
    public CsPerson findPersonById(@RequestParam(value = "id") String id);

    @RequestMapping(value = "/getCsPersonById", method = RequestMethod.POST)
    public CsPerson getCsPersonById(@RequestParam(value = "id") String id) throws Exception;

    @RequestMapping(value = "/getPersonById", method = RequestMethod.POST)
    public CsPerson getPersonById(@RequestParam(value = "id") String id) throws Exception;

    @RequestMapping(value = "/getCsPersonListByMap", method = RequestMethod.POST)
    public List<CsPerson> getCsPersonListByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/getCsPersonCountByMap", method = RequestMethod.POST)
    public Integer getCsPersonCountByMap(@RequestBody Map<String, Object> param) throws Exception;

    @RequestMapping(value = "/addCsPerson", method = RequestMethod.POST)
    public Integer addCsPerson(@RequestBody CsPerson csPerson) throws Exception;

    @RequestMapping(value = "/modifyCsPerson", method = RequestMethod.POST)
    public Integer modifyCsPerson(@RequestBody CsPerson csPerson) throws Exception;

    @RequestMapping(value = "/deleteCsPersonById", method = RequestMethod.POST)
    public Integer deleteCsPersonById(@RequestParam(value = "id") String id) throws Exception;

    @RequestMapping(value = "/insertPerSonRoleBatch", method = RequestMethod.POST)
    public Integer insertPerSonRoleBatch(@RequestBody List<CsRoleUser> list, @RequestParam(value = "id") String id);

}

